<script type="text/javascript">
function ajaxOperationCbk(result){
    clearTipMsgs("wait-msg");
    if(result.code == 0){
        appendTipMessage("alert-msg",result.message,2000);
        $("#serialNumberTable").bootstrapTable("refresh");
    }else if(result.code > 0){
        appendTipMessage("error-msg",result.message);
    }
}
function showDelWaitMsg(){
    clearTipMsgs(["wait-msg","alert-msg","error-msg"]);
    appendTipMessage("wait-msg","${lisFun.escapeForQuot(i18n('cmn_msg_info_deleting'))}");
}
function clearWaitMsg(){
    clearTipMsgs("wait-msg");
}
function editSeriNum(id){
    _tabs.showPage("information",null,{"id":id});
}
function delSeriNums(e,id){
    e.preventDefault();
    e.stopPropagation();
    CommonUtil.del(null,id,"${basePath}/sys/serialnumber/delete",null,ajaxOperationCbk,null,showDelWaitMsg,clearWaitMsg);
}
</script>
<div class="box">
	<div class="box-body">
		<div class="row marginZero">
			<div class="row visa-row">
		        <div id="wait-msg" class="alert alert-info" style="background:url(${baseStaticUrl}/images/ajax-loader.gif) no-repeat scroll 15px 50%;padding-left:35px;display:none;"></div>
		        <div id="alert-msg" class="alert alert-success" style="display:none;"></div>
		        <div id="error-msg" class="alert alert-danger" style="display:none;"></div>
		    </div>
			 <epoch:table id="serialNumberTable" queryUrl="${basePath}/sys/serialnumber/findSerialNumberListAjax" rowId="id" newBtn="false" delBtn="false" showRefresh="true" defTipColHead="true">
		        <epoch:tr check="checkbox" titleTip="全选"></epoch:tr>
		        <epoch:tr name="规则编码" formName="rule_code" width="20%">
		            <a href="javascript:void(0);" onclick="editSeriNum('~{row.id}')">~{value}</a>
		        </epoch:tr>
		        <epoch:tr name="规则名称" formName="rule_name" width="25%"></epoch:tr>
		        <epoch:tr name="流水号重置规则" formName="rule_type" filterType="select"
		            filterData="${lisFun.dictForFilter('SYS_SERIAL_NUMBER')}" width="10%"></epoch:tr>
		        <epoch:tr name="流水号长度" formName="serial_length" width="5%"></epoch:tr>
		        <epoch:tr name="初始值" formName="init_value" width="10%"></epoch:tr>
		        <epoch:tr name="当前值" formName="current_value" width="10%"></epoch:tr>
		        <epoch:tr name="增加步长" formName="step" width="5%"></epoch:tr>
		        <epoch:tr name="前缀" formName="prefix" width="8%"></epoch:tr>
		        <epoch:tr name="分隔符" formName="split" width="5%"></epoch:tr>
		        <epoch:tr name="操作" switchable="false" width="2%">
		            <i class="fa fa-trash-o fa-1-5 cursorPointer" title="删除" onclick="delSeriNums(event,'~{row.id}');"></i>
		        </epoch:tr>
		    </epoch:table>
		</div>
	</div>
</div>
<script type="text/javascript">
	function editSysDict(id){
		if(id!=null){
	        _tabs.showPage("information",null,'ID=' + id,null);
	    }else {
	        _tabs.showPage("information",null,null,null);
	    }
	}
	
	function addClick(){
    	_tabs.showPage("information",null,null,null);
    }
</script>